package com.lzk.springboot.demo.db.dbconfig;


import org.mybatis.spring.MyBatisSystemException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class DBLinkTest {

    private static Logger logger = LoggerFactory.getLogger("CbsServiceLogger");

//    private UsrBaseInfoMapper usrBaseInfoMapper;
//
//    private ZkUserinfoMapper zkUserinfoMapper;

    public void excute(String[] args){
        try{
            logger.info("start to test MySql database connect ...");
//            zkUserinfoMapper = SpringUtil.getBean(ZkUserinfoMapper.class);
//            String isLinkMysql = zkUserinfoMapper.dbIsLink();
//            logger.info("MySql connection test successful ...:"+isLinkMysql);

            logger.info("start to test Oracle database connect ...");
//            usrBaseInfoMapper = SpringUtil.getBean(UsrBaseInfoMapper.class);
//            String isLinkOracle = usrBaseInfoMapper.dbIsLink();
//            logger.info("Oracle connection test successful ...:"+isLinkOracle);

        }catch (MyBatisSystemException e){
            e.printStackTrace();
            logger.info("can not get jdbc connection ... system is close ");
            System.exit(1);
        }
    }
}


